<?php
     include("Entries.php");
	 //Khai bao dia chi webservice
	$webservice = "http://14.160.52.14:10001/CardChargingGW/services/Services?wsdl";
	$soapClient = new SoapClient(null, array('location' => $webservice, 'uri' => "http://127.0.0.1"));
     //login()

//Ham login	 
     $login = new login($soapClient);
     $login-> m_UserName = "hdcvn01";
     $login-> m_Pass = "123456";
     $login-> m_PartnerID = "hdcvn";
     $login-> soapClient = $soapClient ;
     $loginresponse = new loginResponse();
     $loginresponse =  $login-> login_();
     
	print_r($loginresponse);


/*	
//Ham doi password user
	 $ChangePassword = new ChangePassword($soapClient);
	 $ChangePassword -> m_TransID = "hdcvn_222222";
     $ChangePassword-> m_UserName = "hdcvn01";    
     $ChangePassword-> m_PartnerID = "hdcvn";
	 $ChangePassword-> m_OLD_PASSWORD = "123456";
	 $ChangePassword-> m_NEW_PASSWORD = "12345678";
	 $ChangePassword -> m_SessionID = bin2hex( $loginresponse->m_SessionID);
     $ChangePassword-> soapClient = $soapClient ;
     $ChangeResponse = new loginResponse();
     $ChangeResponse =  $ChangePassword-> ChangePassword_();
     print_r($ChangeResponse);
	 */
/*
//Ham doi mpin Partner	 
	 $ChangMPin = new ChangMPin($soapClient);
	 $ChangMPin -> m_TransID = "hdcvn_222222";
     $ChangMPin-> m_UserName = "hdcvn01";    
     $ChangMPin-> m_PartnerID = "hdcvn";
	 $ChangMPin-> m_OLD_OLD_MPIN = "123456";
	 $ChangMPin-> m_NEW_MPIN = "12345678";
	 $ChangMPin -> m_SessionID = bin2hex( $loginresponse->m_SessionID);
     $ChangMPin-> soapClient = $soapClient ;
     $ChangeResponse = new loginResponse();
     $ChangeResponse =  $ChangePassword-> ChangMPin_();
     print_r($ChangeResponse);
*/

 
//Ham nap tien 
//VNP: vinaphone
//VMS: mobifone
//VTC: VTC

     $CardCharging = new CardCharging();
     $CardCharging -> m_TransID = "00040_".time();
     $CardCharging -> m_UserName = "hdcvn01";
     $CardCharging -> m_PartnerID = "hdcvn";
     $CardCharging -> m_MPIN = "123456";
     $CardCharging -> m_Target = "123456";
     $CardCharging -> m_Card_DATA = "123456799:VNP"; //Nap the Vinaphone
	 //$CardCharging -> m_Card_DATA = "123456789:VMS"; //Nap the mobifone
     $CardCharging -> m_SessionID = bin2hex( $loginresponse->m_SessionID);
     $CardCharging-> soapClient = $soapClient ;
     //print_r($CardCharging -> m_SessionID);
     $CardChargingResponse = new CardChargingResponse();
     $CardChargingResponse = $CardCharging->CardCharging_($soapClient);
     print_r($CardChargingResponse);

?>
